home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / HDX_BACK / HDX350 / PART.H < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-09  |  4.0 KB  |  143 lines

  1. /* part.h */
  2.  
  3. /*
  4.  *
  5.  * Atari Hard Disk
  6.  * Boot sector and partitioning structures.
  7.  *
  8.  *----
  9.  * 24-Feb-1986 lmd   Structures from documentation.
  10.  * 15-Aug-1988 jye     Add the dynamic partition structure.
  11.  */
  12.  
  13.  
  14. /*
  15.  * Partition entry;
  16.  * There are four of these on the root sector;
  17.  * longs are in 68000 format.
  18.  */
  19. #define    PART struct _part    /* partition */
  20. PART {
  21.     BYTE p_flg;                /* flag byte */
  22.     BYTE p_id[3];            /* three bytes partition ID */
  23.     long p_st;                /* partition starting sector */
  24.     long p_siz;                /* partition size in sectors */
  25. };
  26.  
  27. #define    DPART struct _dpart    /* the dynamic partition block*/
  28. DPART {
  29.     BYTE flg;                /* flag byte */
  30.     long siz;                /* partition size in sectors */
  31.     DPART *next;            /* the pointer point to next block */
  32. };
  33.  
  34. /*
  35.  * Bits in p_flg:
  36.  */
  37. #define    P_BOOTBIT    0x80        /* 0x80, boot this partition */
  38. #define    P_EXISTS    0x01        /* 0x01, partition exists */
  39. #define    P_NEXISTS    0x00        /* 0x00, partition does not exists */
  40.  
  41.  
  42. /*
  43.  * Format information is used by the Atari
  44.  * Hard Disk Format Utility to get default
  45.  * parameters for formatting the device.
  46.  *
  47.  * This is an image of part of the "set mode"
  48.  * command.
  49.  *
  50.  */
  51. #define    HINFO struct _hinfo    /* formatting information */
  52. HINFO {
  53.     UWORD hi_cc;            /* cylinder count MSB / LSB */
  54.     BYTE hi_dhc;            /* number of heads */
  55.     UWORD hi_rwcc;            /* reduced write current cyl */
  56.     UWORD hi_wpc;            /* write precomp cyl */
  57.     BYTE hi_lz;                /* landing zone */
  58.     BYTE hi_rt;                /* step rate code */
  59.     BYTE hi_in;                /* interleave factor */
  60.     BYTE hi_spt;            /* sectors-per-track */
  61. };
  62.  
  63.  
  64. /*
  65.  * Root sector;
  66.  * This lives on physical sector zero
  67.  * of the device, and describes the device.
  68.  *
  69.  * The structure starts at 0x200 - sizeof(RSECT).
  70.  *
  71.  * longs are in 68000 format.
  72.  *
  73.  */
  74. #define    RSECT struct _rsect    /* root sector */
  75. RSECT {
  76.     HINFO hd_info;            /* formatting information */
  77.     long hd_siz;            /* size of disk, in sectors */
  78.     PART hd_p[4];            /* four partitions */
  79.     long bsl_st;            /* start of bad sector list */
  80.     long bsl_cnt;            /* end of bad sector list */
  81.     UWORD hd_reserved;            /* (reserved word) */
  82. };
  83.  
  84.  
  85. /*
  86.  * Boot sector format.
  87.  * This is identical to that on a floppy disk.
  88.  * '*'d entries are valid values in the boot sector.
  89.  *
  90.  */
  91. #define    BOOT struct _boot
  92. BOOT {
  93.     BYTE b_bra[2];        /*    usually BRA.S to code */
  94.     BYTE b_filler[6];        /*    OEM field, "Loader" or "HDLoad" */
  95.     BYTE b_serial[3];        /*    serial number */
  96.     BYTE b_bps[2];        /* *  bytes per sector */
  97.     BYTE b_spc;            /* *  sectors per cluster */
  98.     BYTE b_res[2];        /* *  number of reserved sectors */
  99.     BYTE b_nfats;        /* *  number of FATs */
  100.     BYTE b_ndirs[2];        /* *  number of root directory entries */
  101.     BYTE b_nsects[2];        /* *  number of sectors on media */
  102.     BYTE b_media;        /* *  media descriptor flag */
  103.     BYTE b_spf[2];        /* *  number of sectors/FAT */
  104.     BYTE b_spt[2];        /*    number of sectors/track */
  105.     BYTE b_nsides[2];        /*    number of sides on media */
  106.     BYTE b_nhid[2];        /*    number of hidden sectors */
  107. };
  108.  
  109.  
  110.  
  111. /*
  112.  * `set_mode' parameter format
  113.  * (22 bytes long + 10 wasted bytes)
  114.  *
  115.  */
  116. #define    SETMODE    struct __setmode
  117. SETMODE {
  118.     BYTE smd_xxxx[3];        /* three bytes of zero */
  119.     BYTE smd_8;            /* 0x08 */
  120.     BYTE smd_yyyy[5];        /* five more zero bytes */
  121.     BYTE smd_bs[3];        /* block size MSB, MIDSB, LSB (0x000200) */
  122.     BYTE smd_1;            /* 0x01 */
  123.     BYTE smd_cc[2];        /* cylinder count MSB LSB */
  124.     BYTE smd_dhc;        /* data head count */
  125.     BYTE smd_rwc[2];        /* reduced-write cylinder MSB LSB */
  126.     BYTE smd_wpc[2];        /* write-precomp cylinder MSB LSB */
  127.     BYTE smd_lz;        /* landing zone */
  128.     BYTE smd_rt;        /* stepping pulse rate code */
  129. };
  130.  
  131.  
  132. /*
  133.  * Logical to physical device mapping table.
  134.  *
  135.  */
  136. #define LOGMAP struct _logmap
  137. LOGMAP {
  138.     int lm_physdev;        /* physical dev# (or -1) */
  139.     int lm_partno;        /* partition number on dev */
  140.     SECTOR lm_start;        /* physical starting block# of partition */
  141.     SECTOR lm_siz;            /* partition size */
  142. };
  143.